package com.cgbl.service.adapter

import android.text.TextUtils
import com.cgbl.service.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.robot.base.model.MemberAdapterBean
import com.robot.base.utils.pic.ImageLoaderUtils

class TeamMemberAdapter :
    BaseQuickAdapter<MemberAdapterBean, BaseViewHolder>(R.layout.app_item_team_avatar) {

    override fun convert(holder: BaseViewHolder, item: MemberAdapterBean) {
        if (TextUtils.isEmpty(item.id)) {
            ImageLoaderUtils.display(
                context, holder.getView(R.id.iv_avatar), R.mipmap.app_ic_add
            )
            holder.setText(R.id.tv_name, "")
        } else {
            ImageLoaderUtils.display(
                context, holder.getView(R.id.iv_avatar), item.accountHead
            )
            holder.setText(R.id.tv_name, item.accountName)
        }

    }

}